/*
 * @Description: 
 * @Author: shuliang
 * @Date: 2022-05-05 10:53:50
 * @LastEditTime: 2022-06-08 09:38:46
 * @LastEditors: shuliang
 */
import { createApp } from 'vue';
import App from './App.vue';
import router from './router';
import pinia from '/@/stores/index';
import { directive } from '/@/utils/directive';
import other from '/@/utils/other';
import 'xe-utils'
import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css'

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import mitt from 'mitt';


const app = createApp(App);

    // 给 vue 实例挂载内部对象，例如：
app.config.globalProperties.$XModal = VXETable.modal
app.config.globalProperties.$XPrint = VXETable.print
app.config.globalProperties.$XSaveFile = VXETable.saveFile
app.config.globalProperties.$XReadFile = VXETable.readFile
app.config.globalProperties.msgSuccess = function(msg:string) {
    this.$message({ showClose: false, message: msg, type: 'success' })
  }
  app.config.globalProperties.msgError = function(msg:string) {
    this.$message({ showClose: false, message: msg, type: 'error' })
  }
  app.config.globalProperties.msgInfo = function(msg:string) {
    this.$message.info(msg)
  }

directive(app);
other.elSvg(app);

app.use(pinia).use(router).use(VXETable).use(ElementPlus).mount('#app');

app.config.globalProperties.mittBus = mitt();
